<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE topic
  PUBLIC "-//OASIS//DTD DITA Composite//EN" "ditabase.dtd">
<topic id="topic1">
    <title id="ci20941">CREATE USER</title>
    <body>
        <p id="sql_command_desc">Defines a new database role with the <codeph>LOGIN</codeph>
            privilege by default.</p>
        <section id="section2">
            <title>Synopsis</title>
            <codeblock id="sql_command_synopsis">CREATE USER <varname>name</varname> [[WITH] <varname>option</varname> [ ... ]]</codeblock>
            <p>where <varname>option</varname> can be:</p>
            <codeblock>      SUPERUSER | NOSUPERUSER
    | CREATEDB | NOCREATEDB
    | CREATEROLE | NOCREATEROLE
    | CREATEUSER | NOCREATEUSER
    | CREATEEXTTABLE | NOCREATEEXTTABLE 
      [ ( <varname>attribute</varname>='<varname>value</varname>'[, ...] ) ]
           where <varname>attributes</varname> and <varname>value</varname> are:
           type='readable'|'writable'
           protocol='gpfdist'|'http'
    | INHERIT | NOINHERIT
    | LOGIN | NOLOGIN
    | REPLICATION | NOREPLICATION
    | CONNECTION LIMIT <varname>connlimit</varname>
    | [ ENCRYPTED | UNENCRYPTED ] PASSWORD '<varname>password</varname>'
    | VALID UNTIL '<varname>timestamp</varname>'
    | IN ROLE <varname>role_name</varname> [, ...]
    | IN GROUP <varname>role_name</varname>
    | ROLE <varname>role_name</varname> [, ...]
    | ADMIN <varname>role_name</varname> [, ...]
    | USER <varname>role_name</varname> [, ...]
    | SYSID <varname>uid</varname>
    | RESOURCE QUEUE <varname>queue_name</varname>
    | RESOURCE GROUP <varname>group_name</varname>
    | [ DENY <varname>deny_point</varname> ]
    | [ DENY BETWEEN <varname>deny_point</varname> AND <varname>deny_point</varname>]</codeblock>
        </section>
        <section id="section3">
            <title>Description</title>
            <p><codeph>CREATE USER</codeph> is an alias for <codeph><xref
                        href="CREATE_ROLE.xml#topic1" type="topic" format="dita"/></codeph>.</p>
            <p>The only difference between <codeph>CREATE ROLE</codeph> and <codeph>CREATE
                    USER</codeph> is that <codeph>LOGIN</codeph> is assumed by default with
                    <codeph>CREATE USER</codeph>, whereas <codeph>NOLOGIN</codeph> is assumed by
                default with <codeph>CREATE ROLE</codeph>. </p>
        </section>
        <section id="section4">
            <title>Compatibility</title>
            <p>There is no <codeph>CREATE USER</codeph> statement in the SQL standard. </p>
        </section>
        <section id="section5">
            <title>See Also</title>
            <p><codeph><xref href="CREATE_ROLE.xml#topic1" type="topic" format="dita"/></codeph></p>
        </section>
    </body>
</topic>
